<template>
	<view class="page-shop">
		<MxGoodItem class="cmp-good-item" v-for="card in list" :info="card" />
		<EmptyData v-if="!hasGood" />
	</view>
</template>

<script>
	import MxGoodItem from '@/components/shop/MxGoodItem.vue';
	import EmptyData from '@/components/common/EmptyData.vue'
	import * as membercardApi from '@/api/membercard.js'
	
	export default {
		components: {
			MxGoodItem,
			EmptyData
		}, 
		data() {
			return {
				list: []
			};
		},
		computed: {
			hasGood() {
				return this.list.length !== 0
			}
		},
		onShow() {
			membercardApi.list().then(res => {
				this.list = res.data
			})
		},
		
	}
</script>

<style lang="scss" scoped>
.page-shop{
	padding: 48rpx 64rpx 0rpx 20rpx;
	.cmp-good-item{
		margin-bottom: 60rpx;
	}
}
</style>
